﻿Public Class LoginForm

    Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click

        Select Case Me.ComboBox1.SelectedIndex
            Case 0 'User
                'The user has limited access and functionality in the demo
                myContextMenu.ShowLoadingDockMaintenance = False
                myContextMenu.ShowWarehouseMaintenance = False
                LoginLevel = LoginCredentials.User
            Case 1 'Manager
                'The manager has full administrative rights in the demo.
                myContextMenu.ShowLoadingDockMaintenance = True
                myContextMenu.ShowWarehouseMaintenance = True
                LoginLevel = LoginCredentials.Manager
            Case 2 'Developer
                'The developer has full administrative rights in the demo.
                'The developer can also view the code samples from the Developer ToolStrip menu
                myContextMenu.ShowLoadingDockMaintenance = True
                myContextMenu.ShowWarehouseMaintenance = True
                LoginLevel = LoginCredentials.Developer
        End Select

        Me.DialogResult = Windows.Forms.DialogResult.OK
        Me.Close()

    End Sub

    Private Sub LoginForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'default the login of the demo to developer
        Me.ComboBox1.SelectedIndex = 2

    End Sub

End Class
